/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.us.service;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import org.apache.poi.ss.usermodel.Row;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.common.utils.excel.ImportExcel;
import com.thinkgem.jeesite.modules.de.entity.AttendanceDe;
import com.thinkgem.jeesite.modules.us.entity.UsAttendanceAdp;
import com.thinkgem.jeesite.modules.us.dao.UsAttendanceAdpDao;
import com.thinkgem.jeesite.modules.warehouse.entity.BIWarehouseKpiData;

/**
 * 美东美西正岗Service
 * @author hui.li
 * @version 2016-09-24
 */
@Service
@Transactional(readOnly = true)
public class UsAttendanceAdpService extends CrudService<UsAttendanceAdpDao, UsAttendanceAdp> {
	/**
	 * 注入DAO层
	 */
	@Autowired
	private  UsAttendanceAdpDao dao;
	public UsAttendanceAdp get(String id) {
		return super.get(id);
	}
	
	public List<UsAttendanceAdp> findList(UsAttendanceAdp usAttendanceAdp) {
		return super.findList(usAttendanceAdp);
	}
	
	public Page<UsAttendanceAdp> findPage(Page<UsAttendanceAdp> page, UsAttendanceAdp usAttendanceAdp) {
		return super.findPage(page, usAttendanceAdp);
	}
	
	@Transactional(readOnly = false)
	public void save(UsAttendanceAdp usAttendanceAdp) {
		super.save(usAttendanceAdp);
	}

	@Transactional(readOnly = false)
	public void delete(UsAttendanceAdp usAttendanceAdp) {
		super.delete(usAttendanceAdp);
	}
	
	@Transactional(readOnly = false)
	public Page<BIWarehouseKpiData> findAllListBIWarehouseKpi(Page<BIWarehouseKpiData> page ,BIWarehouseKpiData data) {
		data.setPage(page);
		page.setList(dao.findAllListBIWarehouseKpi(data));
		return  page;
	}
	
	/**
	 * 根据分组后查询
	 */
	@Transactional(readOnly = false)
	public List<BIWarehouseKpiData> syncUsAttendanceAdp(BIWarehouseKpiData data) {
		return dao.findAllListBIWarehouseKpi2(data);
	}
	
	/**
	 * 批量提交数据
	 * 
	 * @param list
	 */
	@Transactional(readOnly = false)
	public void updateStatus(UsAttendanceAdp adp) {
		dao.updateStatus(adp);
		
	}
	
	public List<UsAttendanceAdp> queryByWarehouse(String warehouseName){
	    return dao.queryByWarehouse(warehouseName);
	}
}